package com.zjw.algorithm.refrofit_read;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

public class Test {

    public interface IService {
        void f1();
    }

    public static void main(String[] args) {
        IService f1 = (IService) Proxy.newProxyInstance(IService.class.getClassLoader(), new Class[]{IService.class}, new InvocationHandler() {
            @Override
            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                return method.invoke(this, args);
            }
        });


        f1.f1();
    }
}
